package com.sunwhite.dubbo.service.impl;

import com.sunwhite.dubbo.service.DemoService;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.stereotype.Component;

//,group = "memeber",
@Service(version = "1.0.0" ,timeout = 10000, interfaceClass = DemoService.class,cache = "lru") //服务分组
//@Service(version = "1.0.0" ,timeout = 10000, interfaceClass = DemoService.class,registry = {"1","2"}) //多注册中心配置
//@Service(version = "1.0.0" ,timeout = 10000, interfaceClass = DemoService.class)
@Component
public class DemoServiceImpl implements DemoService {
    @Override
    public String sayHello(String name) {
        //隐式传参
        Object arg = RpcContext.getContext().get("arg");
        return "provider:"+name+arg;
    }
}
